
package com.netease.xone.widget.richtext.span;

import android.content.Context;
import android.text.Spannable;
import android.text.style.ImageSpan;

import com.netease.xone.dataMgr.EmoticonMgr1;

public class FaceSpanManager {

//    public static final String REGULAR_FACE = "\\[哈哈\\]" + "|" + "\\[hehe\\]";
    public static final String REGULAR_FACE = "\\[(\\S+?)\\]";

    
    private FaceSpanManager() {
        // 不允许实例化
    }

    public static void parseFace(Context context, Spannable sp, String faceStr, int start, int end) {
        int resId = EmoticonMgr1.getInstance(context).getIcon(faceStr);
        if (resId > 0) {
            sp.setSpan(new ImageSpan(context, resId), start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
        }
    }
}
